﻿namespace MicroScheduleServer.Dtos;

public class CreateJobReq
{
    public string Name { get; set; }
    public string Remark { get; set; }

    public EnumJobType JobType { get; set; }
    public EnumTriggerType TriggerType { get; set; }

    #region http
    public string HttpUrl { get; set; }
    public EnumHttpMethod HttpMethod { get; set; }
    public Dictionary<string, string> HttpHeaders { get; set; }
    #endregion

    /// <summary>
    /// 任务开始时间
    /// <list type="bullet">
    /// <item>对于 <c>Once</c> 这个就是执行的时间</item>
    /// <item>对于 <c>Repeat</c> 或 <c>Interval</c> 这个就是开始扫描任务的时间, 基于此可以实现延迟开启</item>
    /// </list>
    /// </summary>
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 对于 <c>Interval</c> 来说间隔的时长(秒数)
    /// </summary>
    public int Interval { get; set; }

    /// <summary>
    /// 用于 <c>Repeat</c> 类型的trigger
    /// </summary>
    public int LoopFrequency { get; set; }
    public List<Trigger.LoopFilter> LoopFilters { get; set; }
}
